home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / mosmllib / Bool.sig < prev    next >
Encoding:
Text File  |  1996-07-03  |  860 b   |  24 lines  |  [TEXT/R*ch]

  1. (* Bool -- SML Standard Library *)
  2.  
  3. val not : bool -> bool
  4.  
  5. val toString   : bool -> string
  6. val fromString : string -> bool option
  7. val scan       : {getc : 'a -> (char * 'a) option} -> 'a -> (bool * 'a) option
  8.  
  9. (* [not b] is the logical negation of b.
  10.  
  11.    [toString b] returns the string "false" or "true" according as b is
  12.    false or true.
  13.  
  14.    [fromString s] scans a boolean b from the string s, after possible
  15.    initial whitespace (blanks, tabs, newlines).  Returns (SOME b) if s
  16.    has a prefix which is either "false" or "true"; the value b is the
  17.    corresponding truth value; otherwise NONE is returned.
  18.  
  19.    [scan {getc} src] scans a boolean b from the stream src, using the
  20.    stream accessor getc.  In case of success, returns SOME(b, rst)
  21.    where b is the scanned boolean value and rst is the remainder of
  22.    the stream; otherwise returns NONE.
  23. *)
  24.